/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 spell_displacement.h

	$Header: /heroes4/spell_displacement.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( SPELL_DISPLACEMENT_H_INCLUDED )
#define SPELL_DISPLACEMENT_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "bitmap_group_ptr.h"
#include "combat_spell_single_target.h"
#include "map_point.h"
#include "mouse_window_ptr.h"

class t_combat_action_message;

// -----------------------------------------------------------------
// displacement spell
// -----------------------------------------------------------------
class t_spell_displacement : public t_combat_spell_single_target
{
public:
	t_spell_displacement( t_battlefield& battlefield, t_spell spell );
	
	virtual double			ai_weight( t_combat_creature const& target ) const;
	virtual void		    cast_and_mirror( t_combat_creature_ptr target, int power );
	virtual t_combat_ai_action_list generate_combat_ai_action_list(t_combat_ai &owner);
	virtual double					get_cancel_weight( t_combat_creature const& target ) const;
	virtual t_mouse_window* mouse_move( t_screen_point const& point,
										std::string& help_text );
	virtual bool            left_click( t_screen_point const& point );
protected:
	enum { k_cursor_count = 16 };

	void			displace( t_combat_creature_ptr target, t_combat_action_message message );
	t_mouse_window* get_cursor( int angle );

	t_map_point_2d     m_delta;
	t_bitmap_group_ptr m_bitmaps[k_cursor_count];
	t_mouse_window_ptr m_last_cursor;
	int				   m_last_angle;
};

#endif // SPELL_DISPLACEMENT_H_INCLUDED
